import { Get, Post } from '../utils/http'

/**
 * 添加购物车
 */
export const addShoppingCartApi = (data = {}) =>
  Post({
    url: 'api/product/addShoppingCart',
    data
  })

/**
 * 我的购物车
 */
export const getMyShoppingCartApi = (data = {}) =>
  Get({
    url: 'api/product/myShoppingCart',
    data
  })

/**
 * 购物车详情
 */
export const getCartDetailApi = (data = {}) =>
  Get({
    url: 'api/product/cartDetail',
    data
  })

/**
 * 获取购物车产品
 */
export const getCartProductsApi = (data = {}) =>
  Get({
    url: 'api/product/cartProducts',
    data
  })

/**
 * 商品是否存在于购物车
 */
export const existsInCartApi = (data = {}) =>
  Get({
    url: 'api/product/existsInCart',
    data
  })

/**
 * 删除购物车
 */
export const delCartApi = (data = {}) =>
  Get({
    url: 'api/product/delShoppingCart',
    data
  })
